/**
 * @Author: leibidong
 * @Description: 返回消息工具类
 * @File:  returnMessage
 * @Version: 1.0.0
 * @Date: 2021/7/4 20:16
 */

package utils

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

/**
 * @Author leibidong
 * @Description 返回成功信息
 * @Date  2021/7/11 17:40
 **/
func ReturnOKMessage(i interface{}, c *gin.Context) {
	c.JSON(http.StatusOK, gin.H{
		"code": ONE,
		"msg":  SUCCESS,
		"data": i,
	})
}

/**
 * @Author leibidong
 * @Description 返回失败信息
 * @Date  2021/7/11 17:40
 **/
func ReturnFailureMessage(i interface{}, c *gin.Context) {
	c.JSON(http.StatusOK, gin.H{
		"code": ZERO,
		"msg":  FAILURE,
		"data": i})
}
